<?php include('../../job/common/pdata_mysql.php'); ?>
<?php 
$pdata = mysql_pconnect($hostname_pdata, $username_pdata, $password_pdata);
if (!$pdata)
  {
  die ("Can Open the database : " . mysql_error());
  }
$db_selected =  mysql_select_db("pdata",$pdata);
if (!$db_selected)
  {
  die ("Can\'t use test_db : " . mysql_error());
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目管理</title>
<style type="text/css">
</style>
<link href="/css/allstyle.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="header"><?php include("../../job/common/header.php") ?></div>
<div id="wrap">
   <div id="tbdisplay">
      <table width="100%" border="1">
        <tr class="">
          <td>序号</td>
          <td>输变电工程名称</td>
          <td>开始时间</td>
          <td>完成时间</td>
          <td>曾用名</td>
          <td>完成与否</td>
          <td>修改</td>
          <td>删除</td>
        </tr>
        <?php 
		  $sql = "select * from project order by pid DESC";
		  $result = mysql_query($sql);
		  $i=1;
		  while ($row = mysql_fetch_array($result))
		  {
		  echo "<tr class='tbdisplay'>";
		  echo "<td>".$i."</td>";
		  echo "  <td><a href='/job/project/project.php?pid=".$row['pid']."'>".$row['projectname']."</a></td>";
		  echo "  <td>".$row['startdate']."</td>";
		  echo "  <td>".$row['enddate']."</td>";
		  echo "  <td>".$row['oldname']."</td>";
		  echo "  <td>".$row['donedraft']."</td>";
		  echo "  <td>"."<a target='_new' href=pro_edit.php?pid=".$row['pid'].">修改</a>"."</td>";
		  echo "  <td>"."<a target='_new' href=pro_del.php?pid=".$row['pid'].">删除</a>"."</td>";
		  echo " </tr>";
		  $i++;
		  }
		  mysql_close($pdata);
		  ?>
      </table>
    </div>
</div>
<div id="footer"><?php include("../../job/common/footer.php") ?></div>
</body>
</html>